using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Colorprj
{
    public partial class MDIMain : Form
    {
        private int childFormNumber = 0;

        public MDIMain()
        {
            InitializeComponent();
        }

        private void ShowNewForm(object sender, EventArgs e)
        {
         

            frmPrd ts = new frmPrd();
            ts.ShowDialog(); 

        }

        private void OpenFile(object sender, EventArgs e)
        {
            ////OpenFileDialog openFileDialog = new OpenFileDialog();
            ////openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            ////openFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            ////if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            ////{
            ////    string FileName = openFileDialog.FileName;
            ////    // TODO: Add code here to open the file.
            ////}

            // Create a new instance of the child form.
            frmSubProduct childForm = new frmSubProduct();
            // Make it a child of this MDI form before showing it.
            //childForm.MdiParent = this;
            childForm.Text = "Window " + childFormNumber++;
            childForm.ShowDialog(); 
        }

        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = saveFileDialog.FileName;
                // TODO: Add code here to save the current contents of the form to a file.
            }
        }

        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void CutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // TODO: Use System.Windows.Forms.Clipboard to insert the selected text or images into the clipboard
            frmInvoice fi = new frmInvoice();
            fi.ShowDialog(); 

        }

        private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // TODO: Use System.Windows.Forms.Clipboard to insert the selected text or images into the clipboard
        }

        private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // TODO: Use System.Windows.Forms.Clipboard.GetText() or System.Windows.Forms.GetData to retrieve information from the clipboard.
        }

        private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //toolStrip.Visible = toolBarToolStripMenuItem.Checked;
            frmrptChallan rc = new frmrptChallan();
            rc.ShowDialog(); 


        }

        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //statusStrip.Visible = statusBarToolStripMenuItem.Checked;
            frmrptInvoice ri = new frmrptInvoice();
            ri.ShowDialog();
        }

        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void MDIMain_Load(object sender, EventArgs e)
        {
            //statusStrip.Items[1].Text = "Atul";
        }

        private void editMenu_Click(object sender, EventArgs e)
        {

        }

        private void redoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChallan childForm = new frmChallan();
            // Make it a child of this MDI form before showing it.
            //childForm.MdiParent = this;
            childForm.Text = "Challan Creation ";
            childForm.ShowDialog(); 
        }

        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmPur childForm = new frmPur();
            // Make it a child of this MDI form before showing it.
            //childForm.MdiParent = this;
            childForm.Text = "Purchase Entry " ;
            childForm.ShowDialog(); 
        }

        private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBuyer buyer = new frmBuyer();
            buyer.ShowDialog();  
        }

        private void test1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void printSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmParty party = new frmParty();
            party.ShowDialog(); 
        }

        private void testToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Test1 t = new Test1();
            //t.Parent = this;
            //t.Show(); 
        }

        private void paymentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmPayment paymwnt = new frmPayment();
            paymwnt.ShowDialog();
        }

        private void salesReturnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmSalesReturn sreturn = new frmSalesReturn();
            sreturn.ShowDialog();  
        }

        private void buyeBillAdjustmentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBuyerBillAdj ba = new frmBuyerBillAdj();
            ba.ShowDialog(); 
        }

        private void productStockToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmrptPrdWiseStck pws = new frmrptPrdWiseStck();
            pws.ShowDialog(); 
        }

        private void buyerWiseOurstandingBillsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmrptChallanListing osbills = new frmrptChallanListing();
            osbills.ShowDialog();  
        }

        private void buyerLedgerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmRptBuyerLedger bl = new frmRptBuyerLedger();
            bl.ShowDialog(); 
        }

        private void reorderLevelReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmRptReOrder rol = new frmRptReOrder();
            rol.ShowDialog();  
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            frmChallan fc = new frmChallan();
            fc.ShowDialog(); 
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            statusStrip.Items[0].Text = DateTime.Now.ToString() ;   
        }

        private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Application.Exit();  
        }

        private void cashBookToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmCashBook cb = new frmCashBook();
            cb.Text = "Cash Book";
            cb.VchType = "CSB";
            cb.TrCode  = "01";
            cb.ShowDialog(); 
        }

        private void bankBookToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmCashBook cb = new frmCashBook();
            cb.Text = "Bank Book";
            cb.VchType = "BKB";
            cb.TrCode = "03";
            cb.ShowDialog(); 
        }

        private void cashBookToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmrptDaybook db = new frmrptDaybook();
           
            db.TrCode = "01";
            db.ShowDialog(); 
        }

        private void bAnkBookToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmrptDaybook db = new frmrptDaybook();
            db.TrCode = "03";
            db.ShowDialog(); 
        }

        private void statementOfAccountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmrptSOA soa = new frmrptSOA();
            soa.ShowDialog(); 
        }

        private void testToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            frmTest ft = new frmTest();
            ft.ShowDialog(); 
        }

        private void salesMasterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmSalesMan fs = new frmSalesMan();
            fs.ShowDialog(); 
  
        }

        private void productWiseSaleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmrptProductWiseSale pws = new frmrptProductWiseSale();
            pws.ShowDialog();
  
        }

        private void partyWiseChallanToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmPartyWiseChllan pws = new frmPartyWiseChllan();
            pws.ShowDialog();
        }

        private void propductWisePurchaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmrptProductWisePurchase pwp = new frmrptProductWisePurchase();
            pwp.ShowDialog(); 
        }

        private void salesManWiseSaleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmrptSalesManWiseSale smwr = new frmrptSalesManWiseSale();
            smwr.ShowDialog(); 
        }

        private void viewMenu_Click(object sender, EventArgs e)
        {

        }
    }
}
